package com.ruoyi.service.tourism.impl;

import com.ruoyi.mapper.tourism.BbRestaurantMapper;
import com.ruoyi.service.tourism.BbRestaurantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author zeo
 * @explain 蚌埠餐饮模块
 * @date 2021/3/12 15:37
 */
@Service
public class BbRestaurantServiceImpl implements BbRestaurantService {

    @Autowired
    BbRestaurantMapper bbRestaurantMapper;

    @Override
    public List<Map<String, Object>> findBbRestaurantMonthList(Map map) {
        return bbRestaurantMapper.findBbRestaurantMonthList(map);
    }

    @Override
    public List<Map<String, Object>> findBbRestaurantDayList(Map map) {
        return bbRestaurantMapper.findBusinessBbDayList(map);
    }

    @Override
    public int addBbRestaurant(Map map) {
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
        map.put("foreignId", uuid);
        bbRestaurantMapper.addShare(map);
        return bbRestaurantMapper.addBbRestaurant(map);
    }

    @Override
    public Map findBbRestaurantById(String id) {
        return bbRestaurantMapper.findBbRestaurantById(id);
    }

    @Override
    public int editBbRestaurant(Map map) {
        return bbRestaurantMapper.editBbRestaurant(map) + bbRestaurantMapper.editShare(map);
    }

    @Override
    public Map getLastDayData(Map map) {
        return bbRestaurantMapper.getLastDayData(map);
    }
}
